﻿package com.wxsoft.business.sale.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wxsoft.business.model.easyui.PageHelper;

import com.wxsoft.business.sale.dao.ISlOrderDetailDao;
import com.wxsoft.business.sale.service.ISlOrderDetailService;
import com.wxsoft.business.sale.pojo.SlOrderDetail;

@Service("slOrderDetailService")
public class SlOrderDetailServiceImpl implements ISlOrderDetailService  {
	@Resource
	private ISlOrderDetailDao dao;
	
	
	public long findCount(SlOrderDetail slOrderDetail) {
		return dao.findCount(slOrderDetail);
	}
	
	public List<SlOrderDetail> findAll(PageHelper page,SlOrderDetail slOrderDetail) {
        List<SlOrderDetail> r = dao.findAll(page,slOrderDetail);
		return r;
	}
	public List<SlOrderDetail> getBy(SlOrderDetail slOrderDetail) {
        List<SlOrderDetail> r = dao.getBy(slOrderDetail);
		return r;
	}
	@Transactional
	public String add(SlOrderDetail slOrderDetail) {
		int r = this.dao.insert(slOrderDetail);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	@Transactional
	public String modify(SlOrderDetail slOrderDetail) {
		int r = this.dao.modify(slOrderDetail);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	@Transactional
	public String delete(SlOrderDetail slOrderDetail) {
		int r = this.dao.delete(slOrderDetail);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	
}
